# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('create_time', models.DateTimeField(verbose_name='创建时间', auto_now_add=True)),
                ('update_time', models.DateTimeField(verbose_name='更新时间', auto_now=True)),
                ('title', models.CharField(verbose_name='标题', max_length=100)),
                ('url', models.CharField(verbose_name='内容链接', max_length=300)),
                ('image', models.ImageField(verbose_name='图片', blank=True, null=True, upload_to='')),
                ('text', models.TextField(verbose_name='内容', blank=True, null=True)),
                ('sequence', models.IntegerField(verbose_name='排序')),
                ('status', models.BooleanField(verbose_name='是否展示', default=True)),
            ],
            options={
                'verbose_name': '广告内容',
                'verbose_name_plural': '广告内容',
                'db_table': 'tb_content',
            },
        ),
        migrations.CreateModel(
            name='ContentCategory',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('create_time', models.DateTimeField(verbose_name='创建时间', auto_now_add=True)),
                ('update_time', models.DateTimeField(verbose_name='更新时间', auto_now=True)),
                ('name', models.CharField(verbose_name='名称', max_length=50)),
                ('key', models.CharField(verbose_name='类别键名', max_length=50)),
            ],
            options={
                'verbose_name': '广告内容类别',
                'verbose_name_plural': '广告内容类别',
                'db_table': 'tb_content_category',
            },
        ),
        migrations.AddField(
            model_name='content',
            name='category',
            field=models.ForeignKey(verbose_name='类别', on_delete=django.db.models.deletion.PROTECT, to='contents.ContentCategory'),
        ),
    ]
